<% include header.ejs %>
<nav id="nav_reg">
    <div>
        <a href="/" >首页</a>
        <span ><%= title %></span>
        <a href="/login">登录</a>
    </div>
</nav>
<p style="height: 44px"></p>
<!--注册表单-->
<div id="form-reg" ng-app="regApp" ng-controller="regCtrl">
    <div class="form_reg">
        <form name="regForm" ng-submit="processRegForm(regForm.$valid)" novalidate>
            <h4>用户注册</h4>
                <input type="text" class="form-control" name="userName" id="userName" ng-minlength="3" ng-maxlength="12" ng-model="regFormData.userName" ng-pattern="/^[a-zA-Z][a-zA-Z0-9_]{2,11}$/" placeholder="请输入用户名" required>
                <label ng-cloak for="inputError" class="control-label text-danger" ng-show="regForm.userName.$invalid && !regForm.userName.$pristine"><i class="glyphicon glyphicon-exclamation-sign"></i>用户名为3-12位只能包含字母、数字、或者字母数字组合</label>
           
                <input type="password" class="form-control" id="userPassword" name="password"placeholder="请输入密码" ng-pattern="/[?!a-zA-Z0-9_]{6,16}/" ng-maxlength="16" ng-model="regFormData.password" required>
                <label ng-cloak for="inputError" class="control-label text-danger" ng-show="regForm.password.$invalid && !regForm.password.$pristine"><i class="glyphicon glyphicon-exclamation-sign"></i>6-16位，只能包含字母数字下划线</label>
            
                <input type="password" class="form-control" pw-check="userPassword" name="confirmPassword" placeholder="请再次输入密码" ng-model="regFormData.confirmPassword" ng-pattern="/[?!a-zA-Z0-9_]{6,16}/" ng-maxlength="16" required>
                <label ng-cloak for="inputError" class="control-label text-danger" ng-show="regForm.confirmPassword.$invalid && !regForm.confirmPassword.$pristine"><i class="glyphicon glyphicon-exclamation-sign"></i>两次输入的密码不匹配</label>
          
                <input type="email" class="form-control" name="email" id="email" ng-model="regFormData.email" ng-pattern="/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/" placeholder="请输入邮箱地址" required>
                <label ng-cloak for="inputError" class="control-label text-danger" ng-show="regForm.email.$invalid && !regForm.email.$pristine"><i class="glyphicon glyphicon-exclamation-sign"></i>请输入正确的邮箱地址</label>
            
                <button class="btn btn-block btn-success btn-reg" ng-disabled="regForm.$invalid">注册</button>
            
        </form>
    </div>

</div>
<% include footer.ejs %>